Data de-duplication

ABSTRACT

A new snapshot of a storage volume is created by suppressing write requests. Once pending write requests from the computing nodes are completed, storage nodes create a new snapshot for the storage volume by allocating a new segment to the new snapshot. Subsequent write requests to the storage volume are then performed on the segments allocated to the new snapshot. An orchestration layer implements a bundled application that is provisioned with storage volumes and containers. A snapshot of the application may be created and used to rollback or clone the application. De-duplication may be performed by creating a signature map and identifying duplicated blocks. Blocks of segments containing duplicated blocks are copied to pool segments and metadata of those segments of the same logical storage unit may be consolidated to pool metadata segments. The identification of duplicate blocks may be performed in a cloud computing platform.

BACKGROUND Field of the Invention

This invention relates to removing duplicated data in a distributedstorage and computation system.

Background of the Invention

In many contexts, it is helpful to eliminate data that is duplicative.This reduces the amount of storage required to store data and furtherreduces write amplification in append-only storage schemes.De-duplication further reduces processing required to perform garbagecollection.

The systems and methods disclosed herein provide an improved approachfor implementing de-duplication.

BRIEF DESCRIPTION OF THE DRAWINGS

In order that the advantages of the invention will be readilyunderstood, a more particular description of the invention brieflydescribed above will be rendered by reference to specific embodimentsillustrated in the appended drawings. Understanding that these drawingsdepict only typical embodiments of the invention and are not thereforeto be considered limiting of its scope, the invention will be describedand explained with additional specificity and detail through use of theaccompanying drawings, in which:

FIG. 1 is a schematic block diagram of a network environment forimplementing methods in accordance with an embodiment of the presentinvention;

FIG. 2 is a process flow diagram of a method for coordinating snapshotcreation with compute nodes and storage nodes in accordance with anembodiment of the present invention;

FIG. 3 is a schematic diagram illustrating the storage of data within astorage node in accordance with an embodiment of the present invention;

FIG. 4 is a process flow diagram of a method for processing writerequests in a storage node in accordance with an embodiment of thepresent invention;

FIG. 5 is a process flow diagram of a method for processing a snapshotinstruction by a storage node in accordance with an embodiment of thepresent invention;

FIG. 6 is a process flow diagram of a method for performing garbagecollection on segments in accordance with an embodiment of the presentinvention;

FIG. 7 is a process flow diagram of a method for reading data from asnapshot in accordance with an embodiment of the present invention;

FIG. 8 is a process flow diagram of a method for cloning a snapshot inaccordance with an embodiment of the present invention;

FIG. 9 illustrates a snapshot hierarchy created in accordance with anembodiment of the present invention;

FIG. 10 is a process flow diagram of a method for rolling back to aprior snapshot in accordance with an embodiment of the presentinvention;

FIG. 11 illustrates the snapshot hierarchy of FIG. 9 as modifiedaccording to the method of FIG. 10 in accordance with an embodiment ofthe present invention;

FIG. 12 is a process flow diagram of a method for reading from a clonevolume in accordance with an embodiment of the present invention;

FIG. 13 is a schematic block diagram of components for implementingorchestration of multi-role applications in accordance with anembodiment of the present invention;

FIG. 14 is a process flow diagram of a method for orchestrating thedeployment of a multi-role application in accordance with an embodimentof the present invention;

FIG. 15 is a process flow diagram of a method for implementingprovisioning constraints in accordance with an embodiment of the presentinvention;

FIG. 16 is a process flow diagram of a method for creating a snapshot ofa multi-role application in accordance with an embodiment of the presentinvention;

FIG. 17 is a process flow diagram of a method for rolling back amulti-role application in accordance with an embodiment of the presentinvention;

FIG. 18A is a schematic diagram illustrating an initial stage ofperforming de-duplication of storage segments in accordance with anembodiment of the present invention;

FIG. 18B is a schematic diagram illustrating modifications to segmentsperformed during de-duplication in accordance with an embodiment of thepresent invention;

FIG. 18C illustrates an initial stage of performing de-duplication inconjunction with a cloud computing platform in accordance with anembodiment of the present invention;

FIG. 19 is a process flow diagram of a method for performingde-duplication in accordance with an embodiment of the presentinvention;

FIG. 20 is a process flow diagram of a method for performingde-duplication in conjunction with a cloud computing platform inaccordance with an embodiment of the present invention;

FIG. 21 is a process flow diagram of a method for processing readrequests on pool segments in accordance with an embodiment of thepresent invention; and

FIG. 22 is a schematic block diagram of an example computing devicesuitable for implementing methods in accordance with embodiments of theinvention.

DETAILED DESCRIPTION

Referring to FIG. 1, the methods disclosed herein may be performed usingthe illustrated network environment 100. The network environment 100includes a storage manager 102 that coordinates the creation ofsnapshots of storage volumes and maintains records of where snapshotsare stored within the network environment 100. In particular, thestorage manager 102 may be connected by way of a network 104 to one ormore storage nodes 106, each storage node having one or more storagedevices 108, e.g. hard disk drives, flash memory, or other persistent ortransitory memory. The network 104 may be a local area network (LAN),wide area network (WAN), or any other type of network including wired,fireless, fiber optic, or any other type of network connections.

One or more compute nodes 110 are also coupled to the network 104 andhost user applications that generate read and write requests withrespect to storage volumes managed by the storage manager 102 and storedwithin the memory devices 108 of the storage nodes 108.

The methods disclosed herein ascribe certain functions to the storagemanager 102, storage nodes 106, and compute node 110. The methodsdisclosed herein are particularly useful for large scale deploymentincluding large amounts of data distributed over many storage nodes 106and accessed by many compute nodes 110. However, the methods disclosedherein may also be implemented using a single computer implementing thefunctions ascribed herein to some or all of the storage manager 102,storage nodes 106, and compute node 110.

Referring to FIG. 2, the illustrated method 200 may be performed inorder to invoke the creation of a new snapshot. Other than a currentsnapshot, which is still subject to change, a snapshot captures thestate of a storage volume at a moment in time and is preferably notaltered in response to subsequent writes to the storage volume.

The method 200 includes receiving, by the storage manager 102 a requestto create a new snapshot for a storage volume. A storage volume asreferred to herein may be a virtual storage volume that may divided intoindividual slices. For example, storage volumes as described herein maybe 1 TB and be divided into 1 GB slices. In general, a slice and itssnapshot are stored on a single storage node 106, whereas a storagevolume may have the slices thereof stored by multiple storage nodes 106.

The request received at step 202 may be received from a human operatoror generated automatically, such as according to backup schedulerexecuting on the storage manager 102 or some other computing device. Thesubsequent steps of the method 200 may be executed in response toreceiving 202 the request

The method 200 may include transmitting 204 a quiesce instruction to allcompute nodes 110 that are associated with the storage volume. Forexample, all compute nodes 110 that have pending write requests to thestorage volume. In some embodiments, the storage manager 102 may store amapping of compute nodes 110 to a particular storage volume used by thecompute nodes 110. Accordingly, step 204 may include sending 204 thequiesce instruction to all of these compute nodes. Alternatively, theinstruction may be transmitted 204 to all compute nodes 110 and includean identifier of the storage volume. The compute nodes 110 may thensuppress any write instructions referencing that storage volume.

The quiesce instruction instructs the compute nodes 110 that receive itto suppress 206 transmitting write requests to the storage nodes 106 forthe storage volume referenced by the quiesce instruction. The quiesceinstruction may further cause the compute nodes 110 that receive it toreport 208 to the storage manager 102 when no write requests are pendingfor that storage volume, i.e. all write requests issued to one or morestorage nodes 106 and referencing slices of that storage volume havebeen acknowledged by the one or more storage nodes 106.

In response to receiving the report of step 208 from one or more computenodes, e.g. all compute nodes that are mapped to the storage node thatis the subject of the snapshot request of step 202, the storage manager102 transmits 210 an instruction to the storage nodes 106 associatedwith the storage volume to create a new snapshot of that storage volume.Step 210 may further include transmitting 210 an instruction to thecompute nodes 110 associated with the storage volume to commence issuingwrite commands to the storage nodes 106 associated with the storagevolume. In some embodiments, the instruction of step 110 may include anidentifier of the new snapshot. Accordingly, subsequent input/outputoperations (IOPs) transmitted 214 from the compute nodes may referencethat snapshot identifier. Likewise, the storage node 106 may associatethe snapshot identifier with data subsequently written to the storagevolume, as described in greater detail below.

In response to receiving 210 the instruction to create a new snapshot,each storage node 106 finalizes 212 segments associated with the currentsnapshot, which may include performing garbage collection, as describedin greater detail below. In addition, subsequent IOPs received by thestorage node may also be processed 216 using the new snapshot as thecurrent snapshot, as is also described in greater detail below.

The storage node 102 may further manage errors in the method 200. Forexample, it may occur that a compute node 110 fails to quiesce. In suchinstances, the storage node 102 may be programmed to abort the creationof a new snapshot. For example, if a compute node 110 to which thestorage volume is mounted fails to quiesce within a timeout period, thestorage node 102 may abort the method 200 and retry, such as after await period or in response to an instruction to do so from anadministrator.

Referring to FIG. 3, the method by which slices are allocated,reassigned, written to, and read from may be understood with respect tothe illustrated data storage scheme. The data of the storage scheme maybe stored in transitory or persistent memory of the storage node 106,such as in the storage devices 108.

For each logical volume, the storage manager 102 may store and maintaina volume map 300. For each slice in the logical volume, the volume mapmay include an entry including a node identifier 302 identifying thestorage node 106 to which the slice is assigned and an offset 304 withinthe logical volume at which the slice begins. In some embodiments,slices are assigned both to a storage node 106 and a specific storagedevice hosted by the storage node 106. Accordingly, the entry mayfurther include a disk identifier of the storage node 106 referencingthe specific storage device to which the slice is assigned.

The remaining data structures of FIG. 3 are stored on each storage node106. The storage node 106 may store a slice map 308. The slice map 308may include entries including a local slice identifier 310 that uniquelyidentifies each slice of the storage node 106, e.g. each slice of eachstorage device hosted by the storage node 106. The entry may furtherinclude a volume identifier 312 that identifies the logical volume towhich the local slice identifier 310 is assigned. The entry may furtherinclude the offset 304 within the logical volume of the slice of thelogical volume assigned to the storage node 106.

In some embodiments, an entry in the slice map 308 is created for aslice of the logical volume only after a write request is received thatreferences the offset 304 for that slice. This further supports theimplementation of overprovisioning such that slices may be assigned to astorage node 106 in excess of its actual capacity since the slice isonly tied up in the slice map 308 when it is actually used.

The storage node 106 may further store and maintain a segment map 314.The segment map 314 includes entries either including or correspondingto a particular physical segment identifier (PSID) 316. For example, thesegment map 314 may be in an area of memory such that each address inthat area corresponds to one PSID 316 such that the entry does notactually need to include the PSID 316. The entries of the segment map314 may further include a slice identifier 310 that identifies a localslice of the storage node 106 to which the PSID 316 has been assigned.The entry may further include a virtual segment identifier (VSID) 318.As described in greater detail below, each time a segment is assigned tological volume and a slice of a logical volume, it may be assigned aVSID 318 such that the VSIDs 318 increase in value monotonically inorder of assignment. In this manner, the most recent PSID 316 assignedto a logical volume and slice of a logical volume may easily bedetermined by the magnitude of the VSIDs 318 mapped to the PSIDs 316. Insome embodiments, VSIDs 318 are assigned in a monotonically increasingseries for all segments assigned to volume ID 312. In other embodiments,each offset 304 and its corresponding slice ID 310 is assigned VSIDsseparately, such that each slice ID 310 has its own corresponding seriesof monotonically increasing VSIDs 318 assigned to segments allocated tothat slice ID 310.

The entries of the segment map 314 may further include a data offset 320for the PSID 316 of that entry. As described in greater detail below,when data is written to a segment it may be written at a first openposition from a first end of the segment. Accordingly, the data offset320 may indicate the location of this first open position in thesegment. The data offset 320 for a segment may therefore be updated eachtime data is written to the segment to indicate where the new first openposition is.

The entries of the segment map 314 may further include a metadata offset322. As described in detail below, for each write request written to asegment, a metadata entry may be stored in that segment at a first openposition from a second end of the segment opposite the first end.Accordingly, the metadata offset 322 in an entry of the segment map 314may indicate a location of this first open position of the segmentcorresponding to the entry.

Each PSID 316 corresponds to a physical segment 324 on a device hostedby the storage node 106. As shown, data payloads 326 from various writerequests are written to the physical segment 324 starting from a firstend (left) of the physical segment. The physical segment may furtherstore index pages 328 such that index pages are written starting from asecond end (right) of the physical segment 324.

Each index page 328 may include a header 330. The header 330 may becoded data that enables identification of a start of an index page 328.The entries of the index page 328 each correspond to one of the datapayloads 326 and are written in the same order as the data payloads 326.Each entry may include a logical block address (LBA) 332. The LBA 332indicates an offset within the logical volume to which the data payloadcorresponds. The LBA 332 may indicate an offset within a slice of thelogical volume. For example, inasmuch as the PSID 316 is mapped to aslice ID 310 that is mapped to an offset 304 within a particular volumeID 312, maps 308 and 314, and an LBA 332 within the slice may be mappedto the corresponding offset 304 to obtain a fully resolved addresswithin the logical volume.

In some embodiments, the entries of the index page 328 may furtherinclude a physical offset 334 of the data payload 326 corresponding tothat entry. Alternatively or additionally, the entries of the index page328 may include a size 336 of the data payload 326 corresponding to theentry. In this manner, the offset to the start of a data payload 326 foran entry may be obtained by adding up the sizes 336 of previouslywritten entries in the index pages 328.

The metadata offset 322 may point to the last index page 328 (furthestfrom right in illustrated example) and may further point to the firstopen entry in the last index page 328. In this manner, for each writerequest, the metadata entry for that request may be written to the firstopen position in the last index page 328. If all of the index pages 328are full, a new index page 328 may be created and stored at the firstopen position from the second end and the metadata for the write requestmay be added at the first open position in that index page 328.

The storage node 106 may further store and maintain a block map 338. Ablock map 338 may be maintained for each logical volume and/or for eachslice offset of each logical volume, e.g. for each local slice ID 310which is mapped to a slice offset and logical volume by slice map 308.The entries of the block map 338 map include entries corresponding toeach LBA 332 within the logical volume or slice of the logical volume.The entries may include the LBA 332 itself or may be stored at alocation within the block map corresponding to an LBA 332.

The entry for each LBA 332 may include the PSID 316 identifying thephysical segment 324 to which a write request referencing that LBA waslast written. In some embodiments, the entry for each LBA 332 mayfurther indicate the physical offset 334 within that physical segment324 to which the data for that LBA was written. Alternatively, thephysical offset 324 may be obtained from the index pages 328 of thatphysical segment. As data is written to an LBA 332, the entry for thatLBA 332 may be overwritten to indicate the physical segment 324 andphysical offset 334 within that segment 324 to which the most recentdata was written.

In embodiments implementing multiple snapshots for a volume and slice ofa volume, the segment map 314 may additionally include a snapshot ID 340identifying the snapshot to which the PSID 316 has been assigned. Inparticular, each time a segment is allocated to a volume and slice of avolume, the current snapshot identifier for that volume and slice of avolume will be included as the snapshot ID 340 for that PSID 316.

In response to an instruction to create a new snapshot for a volume andslice of a volume, the storage node 106 will store the new currentsnapshot identifier, e.g. increment the previously stored currentsnapshot ID 340, and subsequently allocated segments will include thecurrent snapshot ID 340. PSIDs 316 that are not filled and are allocatedto the previous snapshot ID 340 may no longer be written to. Instead,they may be finalized or subject to garbage collection (see FIGS. 5 and6).

FIG. 4 illustrates a method 400 for executing write instructions by astorage node 106, such as write instructions received from anapplication executing on a compute node 110.

The method 400 includes receiving 402 a write request. The write requestmay include payload data, payload data size, and an LBA as well asfields such as a slice identifier, a volume identifier, and a snapshotidentifier. Where a slice identifier is included, the LBA may be anoffset within the slice, otherwise the LBA may be an address within thestorage volume.

The method 400 may include evaluating 404 whether a PSID 316 isallocated to the snapshot referenced in the write request and whetherthe physical segment 324 corresponding to the PSID 316 (“the currentsegment”) has space for the payload data. In some embodiments, as writerequests are performed with respect to a PSID 316, the amount of datawritten as data 326 and index pages 328 may be tracked, such as by wayof the data offset 320 and metadata offset 322 pointers. Accordingly, ifthe amount of previously-written data 326 and the number of allocatedindex pages 328 plus the size of the payload data and its correspondingmetadata entry exceeds the capacity of the current segment it may bedetermined to be full at step 404.

If the current segment is determined 404 to be full, the method 400 mayinclude allocating 406 a new PSID 316 as the current PSID 316 and itscorresponding physical segment 324 as the current segment for thesnapshot referenced in the write request. In some embodiments, thestatus of PSIDs 316 of the physical storage devices 108 may be flaggedin the segment map 314 as allocated or free as a result of allocationand garbage collection, which is discussed below. Accordingly, a freePSID 316 may be identified in the segment map 314 and flagged asallocated.

The segment map 314 may also be updated 408 to include a slice ID 310and snapshot ID 340 mapping the current PSID 316 to the snapshot ID,volume ID 312, and offset 304 included in the write request. Uponallocation, the current PSID 316 may also be mapped to a VSID (virtualsegment identifier) 318 that will be a number higher than previouslyVSIDs 318 such that the VSIDs increase monotonically, subject, ofcourse, to the size limit of the field used to store the VSID 318.However, the size of the field may be sufficiently large that it is notlimiting in most situations.

The method 400 may include writing 410 the payload data to the currentsegment. As described above, this may include writing 410 payload data326 to the free location closest to the first end of the currentsegment.

The method 400 may further include writing 412 a metadata entry to thecurrent segment. This may include writing the metadata entry (LBA, size)to the first free location closest to the second end of the currentsegment. Alternatively, this may include writing the metadata entry tothe first free location in an index page 328 that has room for it orcreating a new index page 328 located adjacent a previous index page328. Steps 410, 412 may include updating one or more pointers or tablethat indicates an amount of space available in the physical segment,such as a pointer 320 to the first free address closest to the first endand a pointer 322 to the first free address closest to the second end,which may be the first free address before the last index page 328and/or the first free address in the last index page. In particular,these pointers may be maintained as the data offset 320 and metadataoffset in the segment map 314 for the current PSID 316.

The method 400 may further include updating 416 the block map 338 forthe current snapshot. In particular, for each LBA 332 referenced in thewrite request, an entry in the block map 338 for that LBA 332 may beupdated to reference the current PSID 316. A write request may write toa range of LBAs 332. Accordingly, the entry for each LBA 332 in thatrange may be updated to refer to the current PSID 316.

Updating the block map 338 may include evaluating 414 whether an entryfor a given LBA 332 referenced in the write request already exists inthe block map 338. If so, then that entry is overwritten 418 to refer tothe current PSID 316. If not, an entry is updated 416 in the block map318 that maps the LBA 332 to the current PSID 316. In this manner, theblock map 338 only references LBAs 332 that are actually written to,which may be less than all of the LBAs 332 of a storage volume or slice.In other embodiments, the block map 338 is of fixed size and includes anentry for each LBA 332 regardless of whether it has been written topreviously. The block map 338 may also be updated to include thephysical offset 334 within the current segment to which the data 326from the write request was written.

In some embodiments, the storage node 106 may execute multiple writerequests in parallel for the same LBA 332. Accordingly, it is possiblethat a later write can complete first and update the block map 338whereas a previous write request to the same LBA 332 completes later.The data of the previous write request is therefore stale and the blockmap 338 should not be updated.

Suppressing of updating the block map 338 may be achieved by using theVSIDs 318 and physical offset 334. When executing a write request for anLBA, the VSID 318 mapped to the segment 324 and the physical offset 334to which the data is to be, or was, written may be compared to the VSID318 and offset 334 corresponding to the entry in the block map 338 forthe LBA 332. If the VSID 318 mapped in the segment map 314 to the PSID316 in the entry of the block map 338 corresponding to the LBA 332, thenthe block map 338 will not be updated. Likewise, if the VSID 318corresponding to the PSID 316 in the block map 338 is the same as theVSID 318 for the write request and the physical offset 334 in the blockmap 338 is higher than the offset 334 to which the data of the writerequest is to be or was written, the block map 338 will not be updatedfor the write request.

As a result of steps 414-418, the block map 338 only lists the PSID 316where the valid data for a given LBA 332 is stored. Accordingly, onlythe index pages 328 of the physical segment 324 mapped to the PSID 316listed in the block map 338 need be searched to find the data for agiven LBA 332. In instances where the physical offset 334 is stored inthe block map 338, no searching is required.

FIG. 5 illustrates a method 500 executed by a storage node 106 inresponse to the new snapshot instruction of step 210 for a storagevolume. The method 500 may be executed in response to an explicitinstruction to create a new snapshot or in response to a write requestthat includes a new snapshot ID 340. The method 500 may also be executedwith respect to a current snapshot that is still being addressed by newwrite requests. For example, the method 500 may be executed periodicallyor be triggered based on usage.

The method 500 may include allocating 502 a new PSID 316 and itscorresponding physical segment 324 as the current PSID 316 and currentsegment for the storage volume, e.g., by including a slice ID 310corresponding to a volume ID 312 and offset 304 included in the newsnapshot instruction or the write request referencing the new snapshotID 340. Allocating 502 a new segment may include updating 504 an entryin the segment map 314 that maps the current PSID 316 to the snapshot ID340 and a slice ID 310 corresponding to a volume ID 312 and offset 304included in the new snapshot instruction.

As noted above, when a PSID 316 is allocated, the VSID 318 for that PSID316 will be a number higher than all VSIDs 318 previously assigned tothat volume ID 312, and possibly to that slice ID 310 (where slices haveseparate series of VSIDs 318). The snapshot ID 340 of the new snapshotmay be included in the new snapshot instruction or the storage node 106may simply assign a new snapshot ID that is the previous snapshot ID 340plus one.

The method 500 may further include finalizing 506 and performing garbagecollection with respect to PSIDs 316 mapped to one or more previoussnapshots IDs 340 for the volume ID 312 in the segment map 314, e.g.,PSIDs 316 assigned to the snapshot ID 340 that was the current snapshotimmediately before the new snapshot instruction was received.

FIG. 6 illustrates a method 600 for finalizing and performing garbagecollection with respect to segment IDs 340 for a snapshot (“the subjectsnapshot”), which may include the current snapshot or a previoussnapshot. The method 600 may include marking 602 as valid latest-writtendata for an LBA 332 in the PSID 316 having the highest VSID 318 in thesegment map 314 and to which data was written for that LBA 332. Marking602 data as valid may include making an entry in a separate table thatlists the location of valid data or entries for metadata in a givenphysical segment 324 or setting a flag in the metadata entries stored inthe index pages 328 of a physical segment 324, e.g., a flag thatindicates that the data referenced by that metadata is invalid or valid.

Note that the block map 338 records the PSID 316 for the latest versionof the data written to a given LBA 332. Accordingly, any references tothat LBA 332 in the physical segment 324 of a PSID 316 mapped to alower-numbered VSID 318 may be marked 604 as invalid. For the physicalsegment 324 of the PSID 316 in the block map 338 for a given LBA 332,the last metadata entry for that LBA 332 may be found and marked asvalid, i.e. the last entry referencing the LBA 332 in the index page 328that is the last index page 328 including a reference to the LBA 332.Any other references to the LBA 332 in the physical segment 324 may bemarked 604 as invalid. Note that the physical offset 334 for the LBA 332may be included in the block map 334, so all metadata entries notcorresponding to that physical offset 334 may be marked as invalid.

The method 600 may then include processing 606 each segment ID S of thePSIDs 316 mapped to the subject snapshot according to steps 608-620. Insome embodiments, the processing of step 606 may exclude a current PSID316, i.e. the last PSID 302 assigned to the subject snapshot. Asdescribed below, garbage collection may include writing valid data froma segment to a new segment. Accordingly, step 606 may commence with thePSID 316 having the lowest-valued VSID 318 for the subject snapshot. Asany segments 324 are filled according to the garbage collection process,they may also be evaluated to be finalized or subject to garbagecollection as described below.

The method 600 may include evaluating 608 whether garbage collection isneeded for the segment ID S. This may include comparing the amount ofvalid data in the physical segment 324 for the segment ID S to athreshold. For example, if only 40% of the data stored in the physicalsegment 324 for the segment ID S has been marked valid, then garbagecollection may be determined to be necessary. Other thresholds may beused, such as value between 30% and 80%. In other embodiments, theamount of valid data is compared to the size of the physical segment324, e.g., the segment ID S is determined to need garbage collection ifthe amount of valid data is less than X % of the size of the physicalsegment 324, where X is a value between 30 and 80, such as 40.

If garbage collection is determined 608 not to be needed, the method 600may include finalizing 610 the segment ID S. Finalizing may includeflagging the segment ID S in the segment map 314 as full and no longeravailable to be written to. This flag may be stored in another tablethat lists finalized PSIDs 316.

If garbage collection is determined 608 to be needed, then the method600 may include writing 612 the valid data to a new segment. Forexample, if the valid data may be written to a current PSID 316, i.e.the most-recently allocated PSID 316 for the subject snapshot, until itscorresponding physical segment 324 full. If there is no room in thephysical segment 324 for the current PSID 316, step 612 may includeassigning a new PSID 316 as the current PSID 316 for the subjectsnapshot. The valid data, or remaining valid data, may then be writtento the physical segment 324 corresponding to the current PSID 316 forthe subject snapshot.

Note that writing 612 the valid data to the new segment maybe processedin the same manner as for any other write request (see FIG. 4) exceptthat the snapshot ID used will be the snapshot ID 340 of the subjectsnapshot, which may not be the current snapshot ID. In particular, themanner in which the new PSID 316 is allocated to the subject snapshotmay be performed in the same manner described above with respect tosteps 406-48 of FIG. 4. Likewise, the manner in which the valid data iswritten to the current segment may be performed in the same manner asfor steps 410-412 of FIG. 4. In some embodiments, writing of valid datato a new segment as part of garbage collection may also include updatingthe block map with the new location of the data for an LBA 332, such asaccording to steps 414-418 of FIG. 4. When the physical segment 324 ofthe current PSID 316 is found to be full, it may itself be subject tothe process 600 by which it is finalized or subject to garbagecollection.

After the valid data is written to a new segment, the method 600 mayfurther include freeing 614 the PSID S in the segment map 314, e.g.,marking the entry in segment map 314 corresponding to PSID S as free.

The process of garbage collection may be simplified for PSIDs 316 thatare associated with the subject snapshot in the segment map 314 but arenot listed in the block map 338 with respect to any LBA 332. Thephysical segments 324 of such PSIDs 316 do not store any valid data.Entries for such PSIDs 316 in the segment map 314 may therefore simplybe deleted and marked as free in the segment map 314

FIG. 7 illustrates a method 700 that may be executed by a storage node106 in response to a read request. The read request may be received froman application executing on a compute node 110. The read request mayinclude such information as a snapshot ID, volume ID (and/or slice ID),LBA, and size (e.g. number of 4 KB blocks to read).

The following steps of the method 700 may be initially executed usingthe snapshot ID 340 included in the read request as “the subjectsnapshot,” i.e., the snapshot that is currently being processed tosearch for requested data. The method 700 includes receiving 702 theread request by the storage node 106 and identifying 704 one or morePSIDs 316 in the segment map 314 assigned to the subject snapshot andsearching 706 the metadata entries for these PSIDs 316 for references tothe LBA 332 included in the read request.

The searching of step 706 may be performed in order of decreasing VSID318, i.e. such that the metadata entries for the last allocated PSID 316is searched first. In this manner, if reference to the LBA 332 is found,the metadata of any previously-allocated PSIDs 316 does not need to besearched.

Searching 706 the metadata for a PSID 316 may include searching one ormore index pages 328 of the physical segment 324 corresponding to thePSID 316. As noted above, one or more index pages 328 are stored at thesecond end of the physical segment 324 and entries are added to theindex pages 328 in the order they are received. Accordingly, thelast-written metadata including the LBA 332 in the last index page 328(furthest from the second end of the physical segment 324) in which theLBA 332 is found will correspond to the valid data for that LBA 332. Tolocate the data 326 corresponding to the last-written metadata for theLBA 332 in the physical segment 324, the sizes 336 for allpreviously-written metadata entries may be summed to find a startaddress in the physical segment 324 for the data 326. Alternatively, ifthe physical offset 334 is included, then the data 326 corresponding tothe metadata may be located without summing the sizes 336.

If reference to the LBA 332 is found 708 in the physical segment 324 forany of the PSIDs 316 allocated to the subject snapshot, the data 326corresponding to the last-written metadata entry including that LBA 332in the physical segment 324 mapped to the PSID 316 having the highestVSID 318 of all PSIDs 316 in which the LBA is found will be returned 710to the application that issued the read request.

If the LBA 332 is not found in the metadata entries for any of the PSIDs316 mapped to subject snapshot, the method 700 may include evaluating712 whether the subject snapshot is the earliest snapshot for thestorage volume of the read request on the storage node 106. If so, thenthe data requested is not available to be read and the method 700 mayinclude returning 714 a “data not found” message or otherwise indicatingto the requesting application that the data is not available.

If an earlier snapshot than the subject snapshot is present for thestorage volume on the storage node 106, e.g., there exists at least onePSID 316 mapped to a snapshot ID 340 that is lower than the snapshot ID340 of the subject snapshot ID, then the immediately preceding snapshotID 340 will be set 716 to be the subject snapshot and processing willcontinue at step 704, i.e. the PSIDs 316 mapped to the subject snapshotwill be searched for the LBA 332 in the read request as described above.

The method 700 is particularly suited for reading data from snapshotsother than the current snapshot that is currently being written to. Inthe case of a read request from the current snapshot, the block map 338may map each LBA 332 to the PSID 316 in which the valid data for thatLBA 332 is written. Accordingly, for such embodiments, step 704 mayinclude retrieving the PSID 332 for the LBA 332 in the write requestfrom the block map 338 and only searching 706 the metadata correspondingto that PSID 316. Where the block map 338 stores a physical offset 334,then the data is retrieved from that physical offset within the physicalsegment 314 of the PSID 336 mapped to the LBA 332 of the read request.

In some embodiments, the block map 332 may be generated for a snapshotother than the current snapshot in order to facilitate executing readrequests, such as where a large number of read requests are anticipatedin order to reduce latency. This may include searching the index pages328 of the segments 324 allocated to the subject snapshot and itspreceding snapshots to identify, for each LBA 332 to which data has beenwritten, the PSID 316 having the highest VSID 318 of the PSIDs 316having physical segments 324 storing data written to the each LBA 332.This PSID 316 may then be written to the block map 318 for the each LBA332. Likewise, the physical offset 334 of the last-written data for thatLBA 332 within the physical segment 324 for that PSID 316 may beidentified as described above (e.g., as described above with respect tosteps 704-716).

Referring to FIG. 8, in some instances it may be beneficial to clone astorage volume. This may include capturing a current state of aprincipal copy of a storage volume and making changes to it withoutaffecting the principal copy of the storage volume. For purposes of thisdisclosure a “principal copy” or “principal snapshot” of a storagevolume refers to an actual production copy that is part of a series ofsnapshots that is considered by the user to be the current, official, ormost up-to-date copy of the storage volume. In contrast, a clone volumeis a snapshot created for experimentation or evaluation but changes toit are not intended by the user to become part of the production copy ofthe storage volume. Stated differently, only one snapshot may be aprincipal snapshot with respect to an immediately preceding snapshot,independent of the purpose of the snapshot. Any other snapshots that areimmediate descendants of the immediately preceding snapshot aresnapshots of a clone volume.

The illustrated method 800 may be executed by the storage manager 102and one or more storage nodes 106 in order to implement thisfunctionality. The method 800 may include receiving 802 a cloneinstruction and executing the remaining steps of the method 800 inresponse to the clone instruction. The clone instruction may be receivedby the storage manager 102 from a user or be generated according to ascript or other program executing on the storage manager 102 or a remotecomputing device in communication with the storage manager 102.

The method 800 may include recording 804 a clone branch in a snapshottree. For example, referring to FIG. 9, in some embodiments, for eachsnapshot that is created for a storage volume, the storage manager 102may create a node S1-S5 in a snapshot hierarchy 900. In response to aclone instruction, the storage manager 102 may create a clone volume andbranch to a node A1 representing the clone volume. In the illustratedexample, a clone instruction was received with respect to the snapshotof node S2. This resulted in the creation of a clone volume representedby node A1 that branches from node S2. Note node S3 and its descendantsare also connected to node S2 in the hierarchy.

In some embodiments, the clone instruction may specify which snapshotthe clone volume is of. In other embodiments, the clone instruction maybe inferred to be a snapshot of a current snapshot. In such embodiments,a new principal snapshot may be created and become the current snapshot.The previous snapshot will then be finalized and be subject to garbagecollection as described above. The clone will then branch from theprevious snapshot. In the illustrated example, if node S2 representedthe current snapshot, then a new snapshot represented by node S3 wouldbe created. The snapshot of node S2 would then be finalized and subjectto garbage collection and the snapshot of the clone volume representedby A1 would be created and node A1 would be added to the hierarchy as adescendent of node S2.

In some embodiments, the clone node A1, and possibly its descendants A2to A4 (representing subsequent snapshots of the clone volume), may bedistinguished from the nodes S1 to S5 representing principal snapshots,such as by means of a flag, a classification of the connection betweenthe node A1 and node S2 that is its immediate ancestor, or by storingdata defining node A1 in a separate data structure.

Following creation of a clone volume, other principal snapshots of thestorage volume may be created and added to represented in the hierarchyby one or more nodes S2 to S5. A clone may be created of any of thesesnapshots and represented by additional clone nodes. In the illustratedexample, node B1 represents a snapshot of a clone volume that is a cloneof the snapshot represented by node S4. Subsequent snapshots of theclone volume are represented by nodes B1 to B3.

Referring again to FIG. 8, the creation of a snapshot for a clone volumeon the storage node 106 may be performed in the identical manner as forany other snapshot, such as according to the methods of FIGS. 2 through6. In particular, one or more segments 806 may be allocated to the clonevolume on storage nodes 106 storing slices of the cloned storage volumeand mapped to the clone volume. IOPs referencing the clone volume may beexecuted 808, such as according to the method 400 of FIG. 4.

In some instances, it may be desirable to store snapshots of a clonevolume on a different storage node 106 than the principal snapshots.Accordingly, the method 800 may include allocating 806 segments to theclone volume on the different storage node 106. This may be invoked bysending a new snapshot instruction referencing the clone volume (i.e.,an identifier of the clone volume) to the different storage node 106 andinstructing one or more compute nodes 110 to route IOPs for the clonevolume to the different storage node 106.

The storage node 102 may store in each node of the hierarchy, dataidentifying one or more storage nodes 106 that store data for thesnapshot represented by that node of the hierarchy. For example, eachnode may store or have associated therewith one or more identifiers ofstorage nodes 106 that store a particular snapshot ID for a particularvolume ID. The node may further map one or more slice IDs (e.g., sliceoffsets) of a storage volume to one storage nodes 106 storing data forthat slice ID and the snapshots for that slice ID.

Referring to FIG. 10, one of the benefits of snapshots is the ability tocapture the state of a storage volume such that it can be restored at alater time. FIG. 10 illustrates a method 1000 for rolling back a storagevolume to a previous snapshot, particularly for a storage volume havingone or more clone volumes.

The method 1000 includes receiving 1002, by the storage manager 102, aninstruction to rollback a storage volume to a particular snapshot SN.The method 1000 may then include processing 1004 each snapshot that is arepresented by a descendent node of the node representing snapshot SN inthe snapshot hierarchy, i.e. snapshots SN+1 to SMAX, where SMAX is thelast principal snapshot that is a descendent of snapshot SN (each“descendent snapshot”). For each descendent snapshot, processing 1004may include evaluating 1006 whether the each descendent is an ancestorof a node representing a snapshot of a clone volume. If not, then thestorage manager 102 may instruct all storage nodes 106 storing segmentsmapped to the descendent snapshot to free 1008 these segments, i.e.delete entries from the segment map referencing the descendent snapshotand marking corresponding PSIDs 316 as free in the segment map 314.

If the descendent snapshot is found 1006 to be an ancestor of a snapshotof a clone volume, then step 1008 is not performed and the snapshot andany segments allocated to it are retained.

FIG. 11 illustrates the snapshot hierarchy following execution of themethod 1000 with respect to the snapshot represented by node S3. As isapparent, snapshot S5 has been removed from the hierarchy and anysegments corresponding to these snapshots will have been freed on one ormore storage nodes 106.

However, since node S4 is an ancestor of clone node B1, it is notremoved and segments corresponding to it are not freed on one or morestorage nodes in response to the roll back instruction. Inasmuch as eachsnapshot contains only data written to the storage volume after it wascreated, previous snapshots may be required to recreate the storagevolume. Accordingly, the snapshots of nodes S3 to S1 are needed tocreate the snapshot of the storage volume corresponding to node B1.

Subsequent principal snapshots of the storage volume will be added asdescendants of the node to which the storage volume was rolled back. Inthe illustrated example, a new principal snapshot is represented by nodeS6 that is an immediate descendent of node S3. Node S4 is only presentdue to clone node B1 and therefore may itself be classified as a clonenode in the hierarchy in response to the rollback instruction of step1002.

Note that FIG. 11 is a simple representation of a hierarchy. There couldbe any number of clone volumes, snapshots of clone volumes, clones ofclone volumes and descendent snapshots of any snapshots of any clonevolume represented by nodes of a hierarchy. Accordingly, to roll back toa particular snapshot of a clone, the method 1000 is the same, exceptthat descendants of a snapshot of a clone volume are treated the same asprincipal snapshots and clones of any of these descendants are treatedthe same as a snapshot of a clone volume.

Referring to FIG. 12, the illustrated method 1200 may be used to executea read request with respect to a storage volume that is represented by ahierarchy generated as described above with respect to FIGS. 8 through11. The illustrated method 1200 may also be executed with respect to astorage volume that includes only principal snapshots that aredistributed across multiple storage nodes, i.e., all the segmentscorresponding to snapshots of the same slice of the storage volume arenot located on the same storage node 106. In that case, the hierarchystored on the storage manager 102 stores the location of the segmentsfor each snapshot and therefore enables them to be located.

The method 1200 may be executed by a storage node 106 (“the currentstorage node”) with information retrieved from the storage manager 102as noted below. The method 1200 may include receiving 1202 a readrequest, which may include such information as a snapshot ID, volume ID(and/or slice ID), LBA, and size (e.g. number of 4 KB blocks to read).

Note that the read request may be issued by an application executing ona compute node 110. The compute node 110 may determine which storagenode 106 to transmit the read request using information from the storagemanager 102. For example, the compute node 110 may transmit a request toobtain an identifier for the storage node 102 storing data for aparticular slice and snapshot of a storage volume. The storage managermay then obtain an identifier and/or address for the storage node 106storing that snapshot and slice of the storage volume from thehierarchical representation of the storage volume and return it to therequesting compute node 110. For example, the storage manager 102 mayretrieve this information from the node in the hierarchy representingthe snapshot included in the read request.

In response to the read request, the current storage node performs thealgorithm illustrated by subsequent steps of the method 1200. Inparticular, the method 1200 may include identifying 1204 segmentsassigned to the snapshot ID of the read request in the segment (“thesubject snapshot”).

The method 1200 may include searching 1206 the metadata of the segmentsidentified in step 1204 for the LBA of the read request. If the LBA isfound, the data from the highest numbered segment having the LBA in itsmetadata is returned, i.e. the data that corresponds to the last-writtenmetadata entry including the LBA.

If the LBA is not found in any of the segments mapped to subjectsnapshot, then the method 1200 may include evaluating 1212 whether thesubject snapshot is the earliest snapshot on the current storage node.If not, then steps processing continues at step 1204 with the previoussnapshot set 1214 as the subject snapshot.

Steps 1204-1214 may be performed in the same manner as for steps 704-714of the method 700, including the various modifications and variationsdescribed above with respect to the method 700.

In contrast to the method 700, if the LBA is not found in any of thesegments corresponding to the subject snapshot for any of the snapshotsevaluated, then the method 1200 may include requesting 1216 a location,e.g. storage node identifier, where an earlier snapshot for the volumeID or slice ID is stored. In response to this request, the storagemanager 102 determines an identifier of a storage node 106 storing thesnapshot corresponding to the immediate ancestor of the earliestsnapshot stored on the current storage node in the hierarchy. Thestorage manager 102 may determine an identifier of the storage node 106relating to the immediate-ancestor snapshot and that stores data for aslice ID and volume ID of the read request as recorded for the ancestornearest ancestor node in the hierarchy of the node corresponding to theearliest snapshot stored on the current storage node.

If the current storage node is found 1218 to be the earliest snapshotfor the storage volume ID and/or slice ID of the read request, then thedata the storage manager 102 may report this fact to the storage node,which will then return 1220 a message indicating that the requested LBAis not available for reading, such as in the same manner as step 714 ofthe method 700.

If another storage node stores an earlier snapshot for the volume IDand/or slice ID of the read request, then the read request may betransmitted 1222 to this next storage node by either the current storagenode or the storage manager 102. The processing may then continue atstep 1202 with the next storage node as the current storage node. Theread request transmitted at step 1222 may have a snapshot ID set to thelatest snapshot ID for the storage volume ID and or slice ID of theoriginal read request.

The method 1200 may be performed repeatedly across multiple storagenodes 106 until the earliest snapshot is encountered or the LBA of theread request is located.

Referring to FIG. 13, storage according to the above-described methodsand systems may be incorporated into an application-orchestrationapproach. In the illustrates approach, an orchestration layer 1300implements a bundled application 1302 including a plurality of roles. Inthe following description, “bundled application” refers to a bundle ofapplications as implemented using the orchestration layer. A “role” isan instance of an executable that is managed by the orchestration layeras described herein as part of the bundled application. Accordingly, a“role” may itself be a standalone application, such as a database,webserver, blogging application, or any other application. Examples ofroles include CASSANDRA, HADOOP, SPARK, DRUID, SQL database, ORACLEdatabase, MONGODB database, WORDPRESS, and the like.

The orchestration layer 1300 may implement a bundled application 1302defining roles and relationships between roles as described in greaterdetail below. The bundled application 1302 may include a manifest 1304that defines the roles of the bundled application 1302, which mayinclude identifiers of roles and possibly a number of instances for eachrole identified. The manifest 1304 may define dynamic functions definehow the number of instances of particular role may grow or shrinkdepending on usage. The orchestration layer 1300 may then create orremove instances for a role as described below as indicated by usage andone or more functions for that role. The manifest 1304 may define atopology of the bundled application 1302, i.e. the relationship betweenroles, such as services of a role that are accessed by another role.

The bundled application 1302 may include provisioning 1306. Theprovisioning 1306 defines the resources of storage nodes 106 and computenodes 110 required to implement the bundle. The provisioning 1306 maydefine resources for the bundle as a whole or for individual roles.Resources may include a number of processors (e.g., processing cores),an amount of memory (e.g., RAM (random access memory), an amount ofstorage (e.g., GB (gigabytes) on a HDD (Hard Disk Drive) or SSD (SolidState Drive)). As described below, these resources may be provisioned ina virtualized manner such that the bundled application 1302 andindividual roles 1312 are not informed of the actual location orprocessing and storage resources and are relieved from anyresponsibility for managing such resources. In particular, storageresources may be virtualized by the storage manager 102 using themethods described above such that storage volumes are allocated and usedwithout requiring the bundled application 1302 or roles to manage theunderlying storage nodes 106 and storage device 108 on which the data ofthe storage volumes is written.

Provisioning 1306 may include static specification of resources and mayalso include dynamic provisioning functions that will invoke allocationof resources in response to usage of the bundled application. Forexample, as a database fills up, additional storage volumes may beallocated. As usage of a bundled application increases, additionalprocessing cores and memory may be allocated to reduce latency.

A bundled application 1302 may further include configuration parameters1308. Configuration parameters may include variables and settings foreach role of the bundle. The configuration parameters are defined by thedeveloper of the role and therefore may include any example of suchparameters for any application known in the art. The configurationparameters may be dynamic or static. For example, some parameters may bedependent on resources such as an amount of memory, processing cores, orstorage. Accordingly, these parameters may be defined as a function ofthese resources. The orchestration layer will then update suchparameters according to the function in response to changes inprovisioning of those resources that are inputs to the function. Forexample, CASSANDRA defines a variable Max_Heap_Size that is normally setto half the memory limit. Accordingly, as the memory provisioned for aCASSANDRA role increases, the value of Max_Heap_Size may be increased tohalf the increased memory.

The bundled application 1302 may further include action hooks 1310 forvarious actions that may be taken with respect to the bundledapplication and/or particular roles of the bundled applications. Actionsmay include some or all of stopping, starting, restarting, takingsnapshots, cloning, and rolling back to a prior snapshot. For eachaction, one or more action hooks may be defined. A hook is aprogrammable routine that is executed by the orchestration layer whenthe corresponding action is invoked. A hook may specify a script ofcommands or configuration parameters input to one or more roles in aparticular order. Hooks for an action may include a pre-action hook(executed prior to implementing an action), an action hook (executed toactually implement the action), and a post action hook (executedfollowing implementation of the action).

The bundled application 1302 may define a plurality of roles 1312. Eachrole may include one or more provisioning constraints. As noted above,the bundled application 1302 and roles 1312 are not aware of theunderlying storage nodes 106 and compute nodes 110 inasmuch as these arevirtualized by the storage manager 102 and orchestration layer 1300.Accordingly, any constraints on allocation of hardware resources may beincluded in the provisioning constraints 1314. As described in greaterdetail below, this may include constraints to create separate faultdomains in order to implement redundancy and constraints on latency.

The role 1312 may define a name space 1316. A name space 1316 mayinclude variables, functions, services, and the like implemented by arole. In particular, interfaces and services exposed by a role may beincluded in the name space. The name space may be referenced through theorchestration layer 1300 by an addressing scheme, e.g. <Bundle ID>.<RoleID>.<Name>. In some embodiments, references to the namespace 1316 ofanother role may be formatted and processed according to the JINJAtemplate engine or some other syntax. Accordingly, each role 1312 mayaccess the variables, functions, services, etc. in the name space 1316of another role 1312 on order to implement a complex applicationtopology. In some instances, credentials for authorizing access to arole 1312 may be shared by accessing the namespace 1316 of that role.

A role 1312 may further include various configuration parameters 1318defined by the role, i.e. as defined by the developer that created theexecutable for the role. As noted above, these parameters 1318 may beset by the orchestration layer 1300 according to the static or dynamicconfiguration parameters 1308. Configuration parameters may also bereferenced in the name space 1316 and be accessible (for reading and/orwriting) by other roles 1312.

Each role 1312 may include a container 1320 executing an instance 1322of the application for that role. The container 1320 may be avirtualization container, such as a virtual machine, that defines acontext within which the application instance 1322 executes,facilitating starting, stopping, restarting, and other management of theexecution of the application instance 1322. Containers 1320 may includeany container technology known in the art such as DOCKER, LXC, LCS, KVM,or the like. In a particular bundled application 1302, there may becontainers 1320 of multiple different types in order to take advantageof a particular container's capabilities to execute a particular role1312. For example, one role 1312 of a bundled application 1302 mayexecute a DOCKER container 1320 and another role 1312 of the samebundled application 1302 may execute an LCS container 1320. The manifest1304 and/or provisioning 1306 may define a particular container 1320 ofthe bundled application 1320 to mount each provisioned storage volumefor use by that container 1320.

Note that a bundled application 1302 as configured in the foregoingdescription may be instantiated and used or may be saved as a templatethat can be used and modified later.

FIG. 14 illustrates a method 1400 for executing a bundled application1302 using the orchestration layer 1300. The method 1400 may includeprovisioning 1402 storage and computation resources according to theprovisioning 1306. This may include allocating storage volumes accordingto the storage requirements, assigning the storage volumes to storagenodes 106, and selecting a compute node 110 or storage node 106providing the required computational resources (processor cores andmemory).

The method 1400 may include creating 1404 role instances for the roles1312 defined by the bundled application 1302. As described above, thismay include creating a container 1320 and instantiating the applicationinstance 1322 of the role 1312 within the container 1320. The order inwhich instances 1322 are created and started may be defined in themanifest 1304.

The method 1400 may include configuring 1406 each role according to theconfiguration parameters 1308, including executing any includedfunctions to determine values for dynamic parameters. As noted above,starting a bundled application 1302 may further include setting up 1408the roles 1312 to reference resources in the name space 1316 of anotherrole 1312. For example, a webserver may be configured to access adatabase by referencing configuration parameters and servicesimplemented by the database.

The method 1400 may further include executing 1410 any hooks 1310defined for the initial startup of the bundled applications.Accordingly, pre-startup, startup, and post startup hooks may beexecuted. Some or all of the functions of steps 1402-1410 may be definedas part of the pre-startup hook. Other functions may also be performedprior to steps 1402-1408 as defined by a pre-startup hook.

The actual commencement of execution of the instances 1322 of thebundled application 1302 may be performed in an order specified by thestartup hook and may include performing any attendant functions of theseinstances 1322 as specified by the startup hook. Following startup, oneor more other actions may be performed as specified by the developer inthe post-startup hook. These actions may invoke functions of theinstances 1322 themselves or executed by the orchestration layer 1300outside of the instances 1322, such as with respect to an operatingsystem executing the containers 1320 for the instances 1322.

The bundled application 1302 may then be accessed 1412 in order toperform the programmed functionality of the application instances 1322.As usage occurs, processing resources will be loaded and storage may befilled. The method 1400 may further include adjusting 1414 provisioningaccording to this usage and may performed adjustment to configurationparameters of the roles 1312 according to this provisioning as definedby the provisioning 1306 and configuration functions 1308.

As noted above, instances of roles may also be created or removedaccording to usage. Accordingly, where indicate by the manifest 1304,instances 1322 for a role 1312 may be created according to steps1402-1410 throughout execution of the bundled application 1302 asdefined by one or more dynamic functions in the manifest 1304 for thatrole 1312.

Referring to FIG. 15, the illustrated method 1500 may be used toimplement provisioning constraints 1314 for a role 1312 or constraintsfor an entire bundled application 1302. The method 1500 may be executedby the orchestration layer 1300, storage manager 102, or a combinationof the two.

The method 1500 may include receiving 1502 the provisioning constraint1314 for one or more roles 1312 of the bundled application 1302 anddetermining 1504 whether the constraint 1314 specify one or both of afault domain constraint and a latency constraint.

If a latency constraint is found 1506 to be included for a role 1312,then computational resources and storage resources to be provisioned forthe role 1312 may be constrained 1508 to be co-located. In particular,latency may be specified in terms of (a) a minimum network delay, (b) aminimum network throughput, (c) an explicit constraint to placecomputation and storage resources in the same subnetwork, or (d) anexplicit constraint to place computation and storage resources on thesame node, i.e. a hybrid compute and storage node 110, 106 that performsthe functions of both types of nodes with a single computer.

This constraint may be passed to the storage manager 102, which thenallocates computational and storage requirements according to it. Inparticular, one or more storage volumes for the role 1312 will beassigned to storage nodes 106 that can either (a) meet the latencyrequirement with respect to compute nodes 110 allocated to the role 1312(b) also provide the computational resources required for the role 1312.

If the constrain for a role 1312 is found 1510 to include a fault domainconstraint, then storage volumes for the role 1312 may be distributed1512 among the storage nodes 106 of the distributed storage system 100according to this requirement. For example, if storage volume B is aredundant (e.g., replica or backup copy) of storage volume A, the faultdomain constraint may indicate this fact. Accordingly, the storagemanager 102 may assign storage volume B to a different storage node 106than storage volume A. Various degrees of constraint may be specified.For example, a fault domain constraint may simply require a differentstorage device 108 but not require a different storage node 106. A faultdomain constraint may require that storage nodes 106 to which storagevolumes are assigned by in separate subnetworks, different geographiclocations, or have some other degree of separation. Similar fault domainconstraints may be specified for roles 1312, which may be constrained toexecute on different compute nodes 110 in order to provide redundantservices and reduce downtime.

The provisioning constraints 1502 based on fault domains and/or latencymay be combined with one or more other constraints. For example, aperformance constraint (IOPs/second) for a storage node may be imposed.Accordingly, only those compute nodes meeting the performancerequirement and the fault domain and/or latency requirements will beselected for provisioning.

As noted above, provisioning 1306 may define a processing requirement,such as a number of processing cores and an amount of storage for arole. Accordingly, compute nodes 110 may be selected at step 1508 suchthat both the latency requirement and processing requirement are met.

Referring to FIG. 16, the illustrated method 1600 may be executed by theorchestration layer 1302 with respect to a bundled application 1302 inorder to create a snapshot of the bundled application 1302 that can belater restored (see the method 1700 of FIG. 17).

The method 1600 may include flushing 1602 application buffers to disk.In many instances, performance of an application is accelerated bymaintaining data in a cache in memory, such that data in the cache isaccessed and updated without requiring writing to a disk in manyinstances, as known in the art. Accordingly, this buffer may be flushed1602 to disk by writing all valid data (i.e., not outdated due to asubsequent write) in the cache to the storage device 108 to which thatdata is addressed, e.g., to which the storage volume referenced by thedata is assigned.

In a like manner, a file system flush may be performed 1604. Performinga file system flush may include ensuring that all IOPs pending to beperformed by the file system have been executed, i.e. written to disk.As for step 1602, data written to a cache for the file system this isvalid may be written to a storage device 108 to which the data isaddressed, e.g., to which the storage volume referenced by the data isassigned.

The method 1600 may then include freezing 1606 the application instances1322 of each role 1312. In particular, inasmuch as each instance 1322 isexecuting within container 1320, the containers 1320 for the roles 1312may be instructed to pause execution of each instance 1322. This mayinclude stopping execution and saving a state of execution of eachinstance 1322 (state variables, register contents, program pointers,function stack, etc.).

The method 1600 may further include creating 1608 a snapshot of storagevolumes provisioned for the bundled application. This may includeexecuting the method 200 of FIG. 2 or any of the above-describedapproaches for implementing a snapshot of a storage volume.

The method 1600 may further include creating 1610 a topology snapshotfor the bundled application 1302. The topology of an application mayinclude some or all of the following information as constituted at thetime of executing step 1610 a listing of the roles 1312, which mayinclude one or more instances 1322 of the same role 1322, relationshipsbetween application instances 1322 of roles 1312 (name spacecross-references, configuration parameters), storage volumes assigned toroles 1312, or other information that describes the topology of thebundled application 1302. Applications may create metadata describingtheir state of operation. This data may also be saved as part of thetopology snapshot.

After the snapshot is created according to the method 1600, theapplication instances may be restarted and the bundled application 1302may continue to operate. If desired, the application may then be rolledback to the snapshot created according to the method 1600, as describedbelow with respect to FIG. 17.

FIG. 17 illustrates a method 1700 for rolling back a bundled application1302 to a snapshot, such as a snapshot created according to the method1600. The method 1700 may be executed by one or both of theorchestration layer 1300 and the storage manager 102.

The method 1700 includes receiving 1702 a rollback instruction, such asfrom an administrator desiring to return to a stable version of thebundled application 1302. The remaining steps of the method 1300 may beexecuted in response to the rollback instruction.

The method 1700 may include rolling 1704 back storage volumes assignedto the bundled application 1302 to the snapshots created for thesnapshot of the bundled application 1302 (e.g., at step 1608 of themethod 1600). This may include executing the method 1000 of FIG. 10 orperforming any other approach for rolling back a storage volume to aprior state.

The method 1700 may include restoring 1706 application instances fromthe application snapshot. As described above with respect to step 1606of the method 1600, an application instance 1322 may be frozen.Accordingly, data describing a state of execution of the applicationinstance 1322 may be reloaded into a container 1302 for that instance.If needed, the container for that application instance 1322 may becreated and the instance 1322 loaded into it prior to loading the stateof execution. This is particularly the case where the number ofapplication instances has changed since the application snapshot wascreate.

The method 1700 may further include restoring 1708 the applicationtopology saved for the bundled application at step 1610. Accordingly,relationships between application instances 1322 of roles 1312 (namespace cross-references, configuration parameters), storage volumesassigned to roles 1312, or other information that describes the topologyof the bundled application 1302 may be restored as it was at the timethe application snapshot was created

The method 1700 further include executing 1710, 1712, 1714 a pre-restarthook, restart hook, and post restart hook defined for the bundledapplication. As described above, each hook may be a routine defined by adeveloper to be executed for a particular action, restarting in thiscase. In step 1712, execution of the instances 1322 for the roles 1322may be restarted, along with any other actions specified by thedeveloper in the restart hook.

The bundled application 1302 as restored at steps 1704-1714 may then beaccessed 1716 as defined by the programming of the application instancesand the restored application topology.

Note that the snapshot of the bundled application 1302 may be restartedon different storage and compute nodes 106, 110 than those on which thebundled application 1302 was executing when the snapshot was created.Accordingly, the application snapshot may be restarted as a clone of thebundled application 1302 or moved to different hardware when executingthe method 1700.

In some instances, the hooks of steps 1710, 1712, 1714 may be differentwhen the application snapshot is being restarted as a clone as desiredby a developer. For example, a developer may desire to scale the cloneapplication to increase or decrease a number of databases, number ofpartitions of a database, or other aspect of the clone application.Accordingly, the hooks of steps 1710, 1712, 1714 may implement routinesto implement this increase or decrease.

For example, some applications are able to automatically detect thenumber of partitions of a database. In such instances, some or all ofthe hooks 1710, 1712, 1714 may reduce the number of partitions in adatabase of the clone applications and rely on the application todiscover this change. In other instances, some or all of the hooks 1710,1712, 1714 may be programmed to configure an application to access thedatabase with the reduced number of partitions where the application isunable to configure itself.

FIG. 18A illustrates an approach for implementing de-duplication.Segments 1800 may be segments created and managed as described abovewith respect to FIGS. 1 through 13. Each segment may include a pluralityof blocks 1802 of data. In particular, the blocks 1802 may correspond tothe payload data 326 shown in FIG. 3. In some embodiments, the blocks1802 have a fixed size, such as 4 kilobytes (kB). The segments 1800 thatare processed during de-duplication may include all the segmentsbelonging to a same storage volume, all the segments on a same storagedevice 108, all the segments storage on storage devices 108 connected tothe same storage node 106, or all segments stored on the storage devices108 of multiple storage nodes 106.

As also described above with respect to FIG. 3, each segment 1802include a metadata section 1804 storing metadata entries including anLBA and a physical offset within the segment 1800 at which the block1802 corresponding to that LBA is written.

Preparatory to identifying duplicate blocks 1802, the segments 1800 maybe evaluated to generate a signature map 1806. The signature map 1806maps a signature 1808 of a block 1802 to one or more segments 1800storing blocks 1802 having that signature 1808. In the illustratedexample, each signature is mapped to one or more PSIDs 1810 that mayidentify physical segments 324 on a particular storage device. Otheridentification approaches may also be used. For example, an entry in thesignature map 1806 may include some or all of the VSID, volume ID, andslice ID to which a segment 1802 is allocated, the segment including ablock 1802 having the signature 1808 of that entry.

Where segments are de-duplicated across multiple devices, a deviceidentifier may further be included and indicate the storage location ofeach segment mapped to a signature 1808 in the signature map 1806.

The signatures 1808 may be in the form of hashes of blocks 1802. In someembodiments, the hashes are much smaller than the blocks they represent,e.g. a 32 byte or larger value to represent a 4 kB block. For example, ahashing algorithm such as SHA 256 may be used. Accordingly, it may bepossible for blocks 1802 to be different and have the same signature.However, using hashes to identify potential matches reduces the numberof blocks 1802 that need to be compared to one another. For example,once all the blocks 1802 with identical hashes are identified, theblocks 1802 may be compared byte by byte to determine whether they arein fact identical.

FIG. 18B illustrates how the segments 1800 may be modified uponidentifying duplicated blocks 1802. In particular, blocks 1802 of thosesegments 1800 having at least one block 1802 that is a duplicate arecopied to pool segments 1812. For each duplicated block 1802, only onecopy of that block is copied to the pool segments 1812.

One or more of the segments 1800 containing duplicated blocks arechanged to pool metadata segments 1814. In particular, the metadata 1804of one or more first duplicated segments 1800 may be copied into asecond duplicated segments and the one or more first duplicated segments1800 may then be deleted. The metadata 1804 in the pool metadatasegments may be modified such that the entries 1816 refer to the poolsegment 1812 and physical offset at which the data corresponding to thatmetadata entry 1804 is written. For example, LBA A1 is included insegment S1 at physical offset P1 within segment S1. If a block of dataB1 at P1 is found to be duplicative, all the blocks of S1 are copied toa pool segment PS1 such that one copy of the block B1 is written to PS1at physical offset P2.

In a first scenario, segment S1 is converted to a pool metadata segment.In that case, the metadata entry for LBA A1 at physical offset P1 may bemodified or rewritten such that LBA A1 is now matched to an identifierof pool segment P1 and includes the physical offset P2.

In another scenario, a different segment S2 is converted to the poolmetadata segment. In that case, a metadata entry is created in segmentS2 for LBA A1 and includes an identifier of pool segment P1 and includesthe physical offset P2.

In some embodiments, metadata entries are consolidated into a commonpool segment only for those segments assigned to the same logicalstorage volume or to the same slice of a logical storage volume. Incontrast, the pool segments 1812 may store data from any number ofslices or logical storage volumes in some embodiments.

Referring back to FIG. 3 while still referring to FIG. 18B, in someembodiments, the segment map 314 may include entries for pool segments182. For example, the slice ID field may be set to be an identifierindicating that that a particular PSID 316 is assigned as a poolsegment. Likewise, a segment that is designated as a pool metadatasegment may be identified as such. Alternatively, the segment map 300may remain unmodified since the pool metadata segment remains assignedto the same slice identifier 310.

As noted above, segments are assigned monotonically increasing VSIDs 318upon allocation and these are used to determine which segment stores thelatest data for an LBA. Accordingly, the metadata entries 316 in a poolmetadata segment may be rewritten to include the VSID of the segmentfrom which the metadata entry was obtained. In this manner, althoughmetadata entries from multiple segments are written to the same poolmetadata segment, the metadata entry with the highest VSID contains thelatest version of data for an LBA. The ordering of metadata entries mayalso be retained, i.e. metadata entries copied from an original segmentto a pool metadata segment may be written in the same order in whichthey were in the original segment. In this manner, if the same LBA waswritten to repeatedly in the same segment, the last-written instance maybe identified from the ordering as discussed above with respect to FIGS.3 through 7.

Those segments 1800 that do not include a duplicated block 1802 mayremain unchanged as shown in FIG. 18B.

Referring to FIG. 18C, in some instances, the impact of de-duplicationmay be reduced by off-loading the identification of duplicates to acloud computing platform 1818. The cloud computing platform may beembodied as AMAZON WEB SERVICES (AWS), MICROSOFT AZURE, GOOGLE CLOUD, orother cloud computing platform. For example, the segments 1800 may becopied to the storage of the cloud computing platform 1818 as segmentcopies 1820. The computing resources of the cloud computing platform1818 may then populate the signature map 1806 and identify duplicateblocks 1802 in the copies 1820 as described above. Pool segments andpool metadata segments may be created in the storage of the cloudcomputing platform 1818 in the same manner described above with respectto FIG. 18B

Those segments having duplicate blocks may then be deleted from storagedevices 108 of premise equipment. For example, the cloud computingplatform 1818 may indicate to the storage manager 102 or storage node106 those segments which were found to include duplicate blocks, such asin the form of a listing of PSIDs, a slice ID and VSID pair, or otheridentifier.

In some instances, pool segments remain on the storage of the cloudcomputing platform 1818 and copies of the pool metadata segments arecopied to the premise storage devices 108. When needed by a storage node106, the entries of the pool metadata segments point to pool segments onthe cloud computing platform 1818 and the storage node 106 may requestdata from the pool segments or an entire pool segment includingrequested data. The data or pool segment including the data may then bereturned by the cloud computing platform 1818 to the storage node 106.

FIG. 19 illustrates a method 1900 for de-duplicating segments. Themethod 1900 is executed with respect to a plurality of original segmentsthat may be on the same storage device 108, on storage devices of thesame storage node 106, or on storage devices 108 of multiple storagenodes. The plurality of original segments may be allocated to multipledifferent slice IDs and/or multiple logical volume IDs. The method 1900is presumed to be executed by a storage node 106 or other computersystem on the same premise as the storage devices 108 storing theplurality of segments, e.g. the same data center or office building.

In some embodiments, the method 1900 is only executed with respect tosegments that are not excepted from the de-duplication process based onan explicit designation of a storage volume or slice of a storage volumeto which the segments are allocated. A segments allocated to a storagevolume or a slice of a storage volume may be excepted based on anautomated determination of the usage of that storage volume or slice ofa storage volume.

For example, an application may include multiple storage volumes, suchas an oracle database with data disks (volumes) and a logdisks(volumes). There may be cases that certain volumes need fast readresponse. In the above example, database log disks need very fastresponse for faster transaction times. It may also be case that aparticular sub-part of the volume, e.g., slice, needs higher readresponse. Accordingly, such storage volumes or slices of storage volumesmay be designated as exempt from deduplication and omitted fromprocessing according to the method 1900.

In another example, certain volumes of an application may be used insuch a way that duplicates do not occur or are highly unlikely to occur.Accordingly, trying to find duplicates is a waste of resources.Accordingly, such storage volumes or slices of storage volumes may beidentified and exempted from de-duplication according to the method1900. For example, the method 1900 may be executed a number of timeswith respect to a storage volume or slice of a storage volume. If anumber of duplicates identified is below a threshold for a predeterminednumber of iterations (1 or more) of the method 1900, the storage volumeor slice of a storage volume may be exempted from processing accordingto the method 1900. In other embodiments, an entire application may beexempted in response to some or all of its storage volumes havingbelow-threshold numbers of duplicates for a pre-determined number ofiterations of the method 1900.

The method 1900 may advantageously be executed periodically, rather thancontinuously, at a point in time at which the storage node 106 isrelatively lightly loaded relative to other times, such as nightly, onweekends, or at other times.

The method 1900 may include creating 1902 a signature map. For example,this may include evaluating all the blocks of all of the plurality ofsegments. For each block (“the subject block”) of the current segmentbeing evaluated (“the subject segment”), a signature (e.g., hash) iscalculated. This hash is then compared to any previous entries in thesignature table. If the hash matches a previous entry, the previousentry is updated to refer to the subject segment and an offset at whichthe subject block is stored in the subject segment. The reference to thesubject segment may include the PSID of the subject segment, the VSIDand slice ID to which the subject segment is mapped in the segment map314, or some other identifier. Where the method 1900 is performed acrossmultiple devices 108 or storage nodes 106, the subject segment may beidentified in the entry by a device ID and/or node ID for the device 108and storage node 106 on which it is stored.

Accordingly, upon completion of step 1902, the signature map willindicate all pairs of possible matches, i.e., each entry in thesignature map that references more than one block indicates a block thatis potentially duplicated.

The method 1900 may then include identifying 1904 matching blocks. Inparticular, for each entry in the signature map referencing multipleblocks, the multiple blocks may be compared. For example, for eachpossible pairing of blocks among the multiple blocks, the blocks in thepairing may be evaluated to determine whether they are identical, thismay include a byte-by-byte comparison. Those blocks in which each andevery byte is the same may be determined to be identical. Where thecomputer system represents values in multiple bytes, e.g., 2, 4, 8bytes, 2, 4, or 8 bytes may be compared simultaneously. If allcomparisons are determined to be identical, then the blocks of thepairing are determined to be identical. As is readily apparent, theremay be any number of blocks determined to all be identical to oneanother.

The method 1900 may then include processing 1906 as “the subjectsegment” according to steps 1908-1912 those segments referenced in thesignature map that include at least one block determined to be identicalto another block at step 1904 (at least one “duplicated block”).

Step 1908 may include copying blocks of the subject segment to one ormore pool segments. If another segment including a duplicated block inthe subject segment has already been copied to the one or more poolsegment, the duplicated block in the subject segment is not copied. Step1908 may include allocating a segment as a current pool segments on astorage device 108, such as by adding an identifier in a field 310, 318,or some other field of a PSID 316 in the segment map 314 for thatstorage device that was previously free. Blocks of the subject segmentmay be copied to the current pool segment until it is full at which timeanother segment may be allocated as the current pool segment and blocksof the subject segment are written to the current pool segment until allblocks (except previously-written duplicated blocks) are written to oneor more of the pool segments.

Step 1910 may include modifying the metadata of the subject segment toindicate where the blocks are written to. For the first instance of aduplicated block that is written to a pool segment, the metadata for theduplicated block may include the LBA that the first instance was writtento, an identifier (e.g., PSID) of the pool segment to which the firstinstance was written, and a physical offset within that pool segment atwhich the first instance was written. Metadata for a non-duplicatedblock is updated in an identical manner.

For a second or any other subsequent instance of the duplicated block ina same or different segment, the metadata is updated to reference theidentifier (e.g., PSID) of the pool segment to which the first instanceof that duplicated block was written, and the physical offset withinthat pool segment at which the first instance was written.

The updated metadata of step 1910 may be written to the metadata of thesubject segment or may be written to memory to be persisted at a latertime.

Step 1912 may further include consolidating the metadata as modified atstep 1910 into pool metadata segments. In particular, for segmentsidentified as having a duplicate block that are assigned to the samelogical storage unit (e.g., same slice ID and volume ID), the metadataof those segments may be written to a subset of those segments and thosesegments that metadata is not written to may be released, e.g., markedas free in the segment map 314. Step 1912 may be performed as eachsubject segment is processed or may be performed after all subjectsegments have been processed according to steps 1908 and 1910.

As noted above with respect to FIG. 18B, consolidating may preserveinformation useful in identifying the latest version of data for an LBA,such as a VSID of the segment from which metadata was copied and theordering of metadata entries and metadata index pages within the segmentfrom which the metadata was copied. For example, the metadata of thesubject segment may be written to a previously-designated pool metadatasegment assigned to the same slice ID and volume ID mapped to thesubject segment in the segment map 314 if there is room in this poolmetadata segment, otherwise the subject segment may be designated as apool metadata segment for the slice ID and volume ID.

FIG. 20 illustrates a method 2000 that may be executed by premiseequipment (storage nodes 106 and storage devices 108 in a common networkand housed in a common structure such as a data center or officebuilding) in conjunction with the cloud computing platform 1818. Themethod 2000 may advantageously be executed periodically at a point intime at which either the premise equipment or cloud computing platformis relatively lightly loaded relative to other times, such as nightly,on weekends, or at other times.

The method 2000 may include copying 2002 the plurality of segments fromone or more storage devices 108 coupled to one or more storage nodes 106to the storage resources of the cloud computing platform 1818. The cloudcomputing platform 1818 may host software for coordinating the copying2002 and for performing the de-duplication according to the method 2000.Steps ascribed below to the cloud computing platform 1818 may beperformed by executing this software. Copying 2002 may be accompaniedwith steps or data to maintain intelligibility of the segments, e.g. amapping that maps the VSID, slice ID, and volume ID mapped to eachsegment to a storage location on the cloud computing platform at whichthe each segment is stored. Copying 2002 may include copying thesegments to cheaper, e.g. archival, storage on the cloud computingplatform to reduce the cost of performing de-duplication.

The cloud computing platform 1818 may then create 2004 a signature tableand identify 2006 matching blocks, such as as described above withrespect to steps 1902 and 1904 of the method 1900.

The method 2000 may then include processing 2008 those segments havingduplicative blocks as “the subject segment” according to steps2010-2014. This may include copying 2010 blocks of the subject segmentto pool segments, modifying 2012 the metadata of the subject segment,and consolidating 2014 the metadata of the subject segment to poolmetadata segments. Steps 2010-2014 may be performed in the same manneras for steps 1908-1912 of the method 1900 except that it is performedusing the computing and storage resources of the cloud computingplatform. As for the method 1900, the consolidating step 2014 may beperformed as each subject segment is processed or after all subjectsegments have been processed.

The method 2000 may further include transmitting 2016 an instructionfrom the cloud computing platform 1818 to the storage node 106 hostingthe storage device 108 storing the subject segment to delete (e.g.,free) the subject segment. For example, the instruction may include thePSID, VSID and volume ID and slice ID, or other identifier orcombination of identifiers sufficient to identify the subject segment.For example, at the copying step 2002, each segment may be sent suchthat some or all of these identifiers and possibly an identifier of thenode 106 and storage device 108 on which the segment is stored areassociated with the each segment. The identifier or identifiers of eachsegment may be mapped by the cloud computing platform to an identifierof a location where the each segment is stored. The storage node 106 mayrespond to the instruction by flagging the PSID mapped to the identifieror identifiers in the instruction by the segment map as being free inthe segment map 314.

The method 2000 may further include transmitting 2018 the pool metadatasegments to the premise, i.e. some or all of the storage nodes 106. Forexample, a pool metadata segment for a volume ID and slice ID may besent to the storage node 106 to which that volume Id and slice ID areassigned. The metadata may reference the pool segments on the cloudcomputing platform such that the storage node may then access the poolsegments using the metadata. For example, each metadata entry may bemodified at step 2012 such that it includes an identifier sufficient touniquely identify the pool segment in which the block of data referencedby the metadata is written on the cloud computing platform and anidentifier of the cloud computing platform.

FIG. 21 illustrates an example method 2100 for processing read requestson a storage node 106 where some segments are pool segments and at leastsome of the pool segments. The method 2100 may be executed by a storagenode receiving the read requests in conjunction with the cloud computingplatform 1818.

The method 2100 includes receiving 2102 a read request, such as from anapplication executing on a source of the read request, which may be acompute node 110, the storage node 106, a cloud computing platform, orsome other source.

The method 2100 may include evaluating 2104 whether the data referencedby the read request is stored on the cloud computing platform, such asin a pool segment. This may be performed in various ways. In oneexample, upon receiving the pool metadata segments, the storage node 106updates the block map 338. For example, the storage node 106 may obtain,from the pool metadata segments, an identifier of the pool segment towhich a block of data corresponding to an LBA 332 was written and thephysical offset within that pool segment at which the block of data iswritten. This pool segment identifier and offset may then be added tothe entry for that LBA 332 in the block map 338 in place of the PSID 316and PO 334 formerly included in that entry.

As noted above, the pool metadata segment may preserve VSIDs of segmentsfrom which blocks were copied. Accordingly, the storage node 106 mayidentify those pool metadata segments corresponding to a slice ID andvolume ID included in the read request. The storage node 106 mayidentify those metadata entries in these pool metadata segments thatreference an LBA. Those metadata entries referencing the LBA thatinclude the highest VSID may also be identified.

Among those metadata entries referencing the LBA and having the highestVSID, the last written metadata entry may be identified. For example,pool metadata segments may be assigned a pool index that increasemonotonically. Metadata from segments may be written to the poolsegments in order of the VSIDs to which segments are mapped.Accordingly, the last written metadata entry for an LBA will be the onethat is in the highest pool indexed pool metadata segment and isfurthest from the second end relative to other metadata entriesreferencing the LBA, presuming writing starting from the second end asdescribed above with respect to FIG. 3. For example, the last writtenmetadata entry may be the last entry referencing the LBA in the indexpage 328 referencing the LBA that is furthest from a second end of thephysical segment 324 storing the highest pool indexed pool metadatasegment having at least one metadata entry referencing the LBA.

In some embodiments, the storage node 106 may provide the block map 338to the cloud computing platform 1818. When a segment corresponding to aPSID 316 is written to a pool segment, the cloud computing platform 1818may update each entry including that PSID 316 to reference the poolsegment identifier and physical offset to which the data correspondingto the LBA of that entry was written. The cloud computing platform 1818may then transmit the updated entries for LBAs of a slice to the storagenode 106 which then replaces the entries for these LBAs with the updatedentries in its block map 338.

The entries of the block map may further include a location field thatindicates whether the data for an LBA 332 is on a storage device 108 ofthe storage node or an identifier of the cloud computing platform 1818.Accordingly, the location field for the each LBA 332 for which thecorresponding data is on the cloud computing platform 1818 may beupdated to include an identifier of the cloud computing platform 1818.Multiple cloud computing platforms may be used such that the locationfield is further used to select the cloud computing platform from whichto request data.

Accordingly, step 2104 may include evaluating whether the location fieldfor an LBA in the block map 338 for the slice ID and volume IDreferenced in the read request references a cloud computing platform1818. If so, the method 2100 may include requesting copying 2106 of thepool segment referenced in the location field from the cloud computingplatform 1818 to a storage device of the storage node 106. The method2100 may further include updating the pool metadata segments referencingblocks of data stored in the copied pool segment to now reference thecopy of the pool segment stored on the storage node 106, e.g., the PSID316 of a physical segment 324 to which the pool segment was copied. Forexample, references to a pool segment identifier on the cloud computingdevice will be replaced with the PSID 316 of the copy stored by thestorage node 106.

The read request may then be executed locally 2110 by reading the blockof data at the LBA referenced by the read request from the pool segmentcopied at step 2106. In particular, by reading the block of data fromthe physical offset within the copied pool segment indicated in theentry of the block map 338 corresponding to the LBA, slice ID, andvolume ID referenced in the read request.

Where the last written data block for the LBA, slice ID, and volume IDreferenced in the read request is not found 2014 to be stored in thecloud, the read request is executed locally 2110 as well in the samemanner described above.

Note that in some embodiments, copying of the pool segment is notperformed unless a threshold frequency of read requests are receivedreferencing blocks of data stored in that pool segment. Otherwise, theread request is sent to the cloud computing platform 1818, which usesits copy of the block map 338 to identify the pool segment and physicaloffset of the block of data corresponding to the LBA, slice ID, andvolume ID of the read request and returns the block of data to thesource of the read request, e.g., the storage node 106 that forwardedthe read request to the cloud computing platform 1818 or the computenode 110 executing the application that issued the read request.

In the case where the method 1900 is executed locally on a storage node,reading may be performed as described in FIG. 21 except that all readrequests will be executed 2110 locally and steps 2102-2108 may beomitted. Note further that the block map 338 may be updated to reflectchanges in the location of a block storing the last written data for anLBA (“the latest block”) in the same manner as described above: as thelatest block is written to a pool segment or is found to be anotherinstance of a block already written to a pool segment, an identifier ofthe pool segment and the physical offset within the pool segment wherethe copy of the latest block is written are added to the entry for thatLBA in the block map 338 and used to process subsequent read requests asdescribed above with respect to step 2110.

FIG. 22 is a block diagram illustrating an example computing device2200. Computing device 2200 may be used to perform various procedures,such as those discussed herein. The storage manager 102, storage nodes106, compute nodes 110, and hybrid nodes, cloud computing platform 1818,or any computing device referenced herein may have some or all of theattributes of the computing device 2200.

Computing device 2200 includes one or more processor(s) 2202, one ormore memory device(s) 2204, one or more interface(s) 2206, one or moremass storage device(s) 2208, one or more Input/output (I/O) device(s)2210, and a display device 2230 all of which are coupled to a bus 2212.Processor(s) 2202 include one or more processors or controllers thatexecute instructions stored in memory device(s) 2204 and/or mass storagedevice(s) 2208. Processor(s) 2202 may also include various types ofcomputer-readable media, such as cache memory.

Memory device(s) 2204 include various computer-readable media, such asvolatile memory (e.g., random access memory (RAM) 2214) and/ornonvolatile memory (e.g., read-only memory (ROM) 2216). Memory device(s)2204 may also include rewritable ROM, such as Flash memory.

Mass storage device(s) 2208 include various computer readable media,such as magnetic tapes, magnetic disks, optical disks, solid-statememory (e.g., Flash memory), and so forth. As shown in FIG. 22, aparticular mass storage device is a hard disk drive 2224. Various drivesmay also be included in mass storage device(s) 2208 to enable readingfrom and/or writing to the various computer readable media. Mass storagedevice(s) 2208 include removable media 2226 and/or non-removable media.

I/O device(s) 2210 include various devices that allow data and/or otherinformation to be input to or retrieved from computing device 2200.Example I/O device(s) 2210 include cursor control devices, keyboards,keypads, microphones, monitors or other display devices, speakers,printers, network interface cards, modems, lenses, CCDs or other imagecapture devices, and the like.

Display device 2230 includes any type of device capable of displayinginformation to one or more users of computing device 2200. Examples ofdisplay device 2230 include a monitor, display terminal, videoprojection device, and the like.

Interface(s) 2206 include various interfaces that allow computing device2200 to interact with other systems, devices, or computing environments.Example interface(s) 2206 include any number of different networkinterfaces 2220, such as interfaces to local area networks (LANs), widearea networks (WANs), wireless networks, and the Internet. Otherinterface(s) include user interface 2218 and peripheral device interface2222. The interface(s) 2206 may also include one or more peripheralinterfaces such as interfaces for printers, pointing devices (mice,track pad, etc.), keyboards, and the like.

Bus 2212 allows processor(s) 2202, memory device(s) 2204, interface(s)2206, mass storage device(s) 2208, I/O device(s) 2210, and displaydevice 2230 to communicate with one another, as well as other devices orcomponents coupled to bus 2212. Bus 2212 represents one or more ofseveral types of bus structures, such as a system bus, PCI bus, IEEE1394 bus, USB bus, and so forth.

For purposes of illustration, programs and other executable programcomponents are shown herein as discrete blocks, although it isunderstood that such programs and components may reside at various timesin different storage components of computing device 2200, and areexecuted by processor(s) 2202. Alternatively, the systems and proceduresdescribed herein can be implemented in hardware, or a combination ofhardware, software, and/or firmware. For example, one or moreapplication specific integrated circuits (ASICs) can be programmed tocarry out one or more of the systems and procedures described herein.

In the above disclosure, reference has been made to the accompanyingdrawings, which form a part hereof, and in which is shown by way ofillustration specific implementations in which the disclosure may bepracticed. It is understood that other implementations may be utilizedand structural changes may be made without departing from the scope ofthe present disclosure. References in the specification to “oneembodiment,” “an embodiment,” “an example embodiment,” etc., indicatethat the embodiment described may include a particular feature,structure, or characteristic, but every embodiment may not necessarilyinclude the particular feature, structure, or characteristic. Moreover,such phrases are not necessarily referring to the same embodiment.Further, when a particular feature, structure, or characteristic isdescribed in connection with an embodiment, it is submitted that it iswithin the knowledge of one skilled in the art to affect such feature,structure, or characteristic in connection with other embodimentswhether or not explicitly described.

Implementations of the systems, devices, and methods disclosed hereinmay comprise or utilize a special purpose or general-purpose computerincluding computer hardware, such as, for example, one or moreprocessors and system memory, as discussed herein. Implementationswithin the scope of the present disclosure may also include physical andother computer-readable media for carrying or storingcomputer-executable instructions and/or data structures. Suchcomputer-readable media can be any available media that can be accessedby a general purpose or special purpose computer system.Computer-readable media that store computer-executable instructions arecomputer storage media (devices). Computer-readable media that carrycomputer-executable instructions are transmission media. Thus, by way ofexample, and not limitation, implementations of the disclosure cancomprise at least two distinctly different kinds of computer-readablemedia: computer storage media (devices) and transmission media.

Computer storage media (devices) includes RAM, ROM, EEPROM, CD-ROM,solid state drives (“SSDs”) (e.g., based on RAM), Flash memory,phase-change memory (“PCM”), other types of memory, other optical diskstorage, magnetic disk storage or other magnetic storage devices, or anyother medium which can be used to store desired program code means inthe form of computer-executable instructions or data structures andwhich can be accessed by a general purpose or special purpose computer.

An implementation of the devices, systems, and methods disclosed hereinmay communicate over a computer network. A “network” is defined as oneor more data links that enable the transport of electronic data betweencomputer systems and/or modules and/or other electronic devices. Wheninformation is transferred or provided over a network or anothercommunications connection (either hardwired, wireless, or a combinationof hardwired or wireless) to a computer, the computer properly views theconnection as a transmission medium. Transmissions media can include anetwork and/or data links, which can be used to carry desired programcode means in the form of computer-executable instructions or datastructures and which can be accessed by a general purpose or specialpurpose computer. Combinations of the above should also be includedwithin the scope of computer-readable media.

Computer-executable instructions comprise, for example, instructions anddata which, when executed at a processor, cause a general purposecomputer, special purpose computer, or special purpose processing deviceto perform a certain function or group of functions. The computerexecutable instructions may be, for example, binaries, intermediateformat instructions such as assembly language, or even source code.Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the described features or acts described above.Rather, the described features and acts are disclosed as example formsof implementing the claims.

Those skilled in the art will appreciate that the disclosure may bepracticed in network computing environments with many types of computersystem configurations, including, an in-dash vehicle computer, personalcomputers, desktop computers, laptop computers, message processors,hand-held devices, multi-processor systems, microprocessor-based orprogrammable consumer electronics, network PCs, minicomputers, mainframecomputers, mobile telephones, PDAs, tablets, pagers, routers, switches,various storage devices, and the like. The disclosure may also bepracticed in distributed system environments where local and remotecomputer systems, which are linked (either by hardwired data links,wireless data links, or by a combination of hardwired and wireless datalinks) through a network, both perform tasks. In a distributed systemenvironment, program modules may be located in both local and remotememory storage devices.

Further, where appropriate, functions described herein can be performedin one or more of: hardware, software, firmware, digital components, oranalog components. For example, one or more application specificintegrated circuits (ASICs) can be programmed to carry out one or moreof the systems and procedures described herein. Certain terms are usedthroughout the description and claims to refer to particular systemcomponents. As one skilled in the art will appreciate, components may bereferred to by different names. This document does not intend todistinguish between components that differ in name, but not function.

It should be noted that the sensor embodiments discussed above maycomprise computer hardware, software, firmware, or any combinationthereof to perform at least a portion of their functions. For example, asensor may include computer code configured to be executed in one ormore processors, and may include hardware logic/electrical circuitrycontrolled by the computer code. These example devices are providedherein purposes of illustration, and are not intended to be limiting.Embodiments of the present disclosure may be implemented in furthertypes of devices, as would be known to persons skilled in the relevantart(s).

At least some embodiments of the disclosure have been directed tocomputer program products comprising such logic (e.g., in the form ofsoftware) stored on any computer useable medium. Such software, whenexecuted in one or more data processing devices, causes a device tooperate as described herein.

While various embodiments of the present disclosure have been describedabove, it should be understood that they have been presented by way ofexample only, and not limitation. It will be apparent to persons skilledin the relevant art that various changes in form and detail can be madetherein without departing from the spirit and scope of the disclosure.Thus, the breadth and scope of the present disclosure should not belimited by any of the above-described exemplary embodiments, but shouldbe defined only in accordance with the following claims and theirequivalents. The foregoing description has been presented for thepurposes of illustration and description. It is not intended to beexhaustive or to limit the disclosure to the precise form disclosed.Many modifications and variations are possible in light of the aboveteaching. Further, it should be noted that any or all of theaforementioned alternate implementations may be used in any combinationdesired to form additional hybrid implementations of the disclosure.

The invention claimed is:
 1. A method comprising: providing a pluralityof segments stored on one or more storage devices coupled to a computersystem, each segment of the plurality of segments including a pluralityof data blocks and a metadata section including a plurality of metadataentries, each data block of the plurality data blocks having acorresponding metadata entry of the plurality of metadata entriesincluding a logical address for the each data block and an offset withinthe each segment at which the each data block is written; (a)identifying, by an evaluating computer system, a plurality of duplicatedblocks, each block of the plurality of duplicated blocks having at leasttwo identical copies among the plurality of data blocks of the pluralityof segments, the evaluating computer system being one of the computersystem and a different computer system; and (b) for each matched segmentof the plurality of segments, the matched segments being segments of theplurality of segments having a data block of the plurality of datablocks thereof that is one of the plurality of duplicated blocks:copying the data block of the plurality of duplicated blocks of the eachmatched segment to one of a plurality of pool segments; and providing apool metadata segment of a plurality of pool metadata segments storingdata from the metadata section of the each matched segment; whereinproviding the pool metadata segment for one or more first segments ofthe matched segments comprises designating the one or more firstsegments as the pool metadata segment; and wherein providing the poolmetadata segment for one or more second segments of the matched segmentscomprises copying at least a portion of the metadata sections of the oneor second segments to the one or more first segments.
 2. The method ofclaim 1, wherein providing the pool metadata segment for each secondsegment of the one or more second segments comprises: identifying one ofthe one or more first segments that is assigned to a same logicalstorage unit as the each second segment; and copying the at least theportion of the metadata section of the each second segment to the one ofthe one or more first segments.
 3. The method of claim 1, wherein theevaluating computer system is a cloud computing platform.
 4. The methodof claim 3, further comprising: copying the plurality of segments to thecloud computing platform to obtain a plurality of cloud segments; andperforming (a) and (b) on the plurality of cloud segments.
 5. The methodof claim 4, further comprising: after performing (a) and (b),instructing the computer system to delete the matched segments from theone or more storage devices.
 6. A method comprising: providing aplurality of segments stored on one or more storage devices coupled to acomputer system, each segment of the plurality of segments including aplurality of data blocks and a metadata section including a plurality ofmetadata entries, each data block of the plurality data blocks having acorresponding metadata entry of the plurality of metadata entriesincluding a logical address for the each data block and an offset withinthe each segment at which the each data block is written; (a)identifying, by an evaluating computer system, a plurality of duplicatedblocks, each block of the plurality of duplicated blocks having at leasttwo identical copies among the plurality of data blocks of the pluralityof segments, the evaluating computer system being one of the computersystem and a different computer system; and (b) for each matched segmentof the plurality of segments, the matched segments being segments of theplurality of segments having a data block of the plurality of datablocks thereof that is one of the plurality of duplicated blocks:copying the data block of the plurality of data blocks of the eachmatched segment to one of a plurality of pool segments; and providing apool metadata segment of a plurality of pool metadata segments storingdata from the metadata section of the each matched segment; wherein theevaluating computer system is a cloud computing platform; wherein themethod further comprises: copying the plurality of segments to the cloudcomputing platform to obtain a plurality of cloud segments; performing(a) and (b) on the plurality of cloud segments; after performing (a) and(b), instructing the computer system to delete the matched segments fromthe one or more storage devices; modifying each pool metadata segment ofthe plurality of pool metadata segments to reference one or more of theplurality of pool segments to obtain a plurality of modified poolmetadata segments, the plurality of pool segments being stored on thecloud computing platform; and transmitting the plurality of modifiedpool metadata segments to the computer system.
 7. The method of claim 6,further comprising: detecting, by the computer system, a request to readdata in the plurality of pool segments; and identifying, by the computersystem, a pool segment referenced by the request according to theplurality of metadata segments.
 8. The method of claim 7, furthercomprising, in response to the request, at least one of: requesting, bythe computer system, transfer of the pool segment referenced by therequest; and requesting, by the computer system, reading of data fromthe pool segment referenced by the request.
 9. A system comprising acloud computing platform including storage resources and computationresources, the storage resources and computation resources comprisinghardware devices, the computation resources programmed to: receive aplurality of segments, each segment of the plurality of segmentsincluding a plurality of data blocks and a metadata section including aplurality of metadata entries, each data block of the plurality datablocks having a corresponding metadata entry of the plurality ofmetadata entries including a logical address for the each data block andan offset within the each segment at which the each data block iswritten; (a) identify a plurality of duplicated blocks, each block ofthe plurality of duplicated blocks having at least two identical copiesamong the plurality of data blocks of the plurality of segments; and (b)for each matched segment of the plurality of segments, the matchedsegments being segments of the plurality of segments having a data blockof the plurality of data blocks thereof that is one of the plurality ofduplicated blocks: copy the data blocks of the plurality of data blocksof the each matched segment to one of a plurality of pool segments; andprovide a pool metadata segment of a plurality of pool metadata segmentsstoring data from the metadata section of the each matched segment;wherein the computation resources are programmed to provide the poolmetadata segment for one or more first segments of the matched segmentsby designating the one or more first segments as the pool metadatasegment; and wherein the computation resources are programmed to providethe pool metadata segment for one or more second segments of the matchedsegments by copying the data from the metadata sections of the one orsecond segments to the one or more first segments and designating theone or more second segments as free.
 10. The system of claim 9, whereinthe computation resources are programmed to provide the pool metadatasegment for each second segment of the one or more second segments by:identifying one of the one or more first segments that is assigned to asame logical storage unit as the each second segment; and copying thedata from the metadata section of the each second segment to the one ofthe one or more first segments.
 11. The system of claim 9, wherein thecomputation resources are programmed to: copy the plurality of metadatasegments to a source device from the cloud computing platform from whichthe plurality of segments were received without copying the plurality ofpool segments to the source device.
 12. The system of claim 9, whereinthe computation resources are programmed to: instruct a source device todelete the matched segments, the plurality of segments being receivedfrom the source device.
 13. A system comprising a cloud computingplatform including storage resources and computation resources, thestorage resources and computation resources comprising hardware devices,the computation resources programmed to: receive a plurality ofsegments, each segment of the plurality of segments including aplurality of data blocks and a metadata section including a plurality ofmetadata entries, each data block of the plurality data blocks having acorresponding metadata entry of the plurality of metadata entriesincluding a logical address for the each data block and an offset withinthe each segment at which the each data block is written; (a) identify aplurality of duplicated blocks, each block of the plurality ofduplicated blocks having at least two identical copies among theplurality of data blocks of the plurality of segments; and (b) for eachmatched segment of the plurality of segments, the matched segments beingsegments of the plurality of segments having a data block of theplurality of data blocks thereof that is one of the plurality ofduplicated blocks: copy the data block of the plurality of data blocksof the each matched segment to one of a plurality of pool segments; andprovide a pool metadata segment of a plurality of pool metadata segmentsstoring data from the metadata section of the each matched segment;wherein the computation resources are programmed to: instruct a sourcedevice to delete the matched segments, the plurality of segments beingreceived from the source device; modify each pool metadata segment ofthe plurality of pool metadata segments to reference one or more of theplurality of pool segments to obtain a plurality of modified poolmetadata segments; and transmit the plurality of modified pool metadatasegments to the computer system.
 14. The system of claim 13, wherein thecomputation resources are further programmed to: detect a request toread data in the plurality of pool segments; identify a pool segmentreferenced by the request according to the plurality of metadatasegments; and return the pool segment to a source of the request. 15.The system of claim 13, wherein the computation resources are furtherprogrammed to: detect a request to read data in the plurality of poolsegments; identify a pool segment referenced by the request according tothe plurality of metadata segments; retrieve the data from the poolsegment referenced by the request; and return the data to a source ofthe request.